global class Cald_NewClaim {
	static Callidus_Claim__c claimObj = null;
	Webservice static Callidus_Claim__c createClaim(ID oppId)
	{
		Opportunity[] oppList = [select Amount, CloseDate from Opportunity where id = :oppId];
		claimObj = new Callidus_Claim__c(Claim_Status__c = 'Draft', Opportunity__c = oppId, Credit__c = oppList[0].Amount, Filing_Date__c = oppList[0].CloseDate);
		insert claimObj;
		return claimObj;
	}
	
    static testMethod void testCald_NewDisputeWS()
    {
    	Opportunity[] oList = [select id from Opportunity];
    	Callidus_Claim__c cd = null;
    	if(oList.size() > 0)
    		cd = createClaim(oList[0].id);
    		
    	Callidus_Claim__c[] ccList = [select Opportunity__c from Callidus_Claim__c where Opportunity__c = :oList[0].id];
		system.assertEquals(cd.Opportunity__c, ccList[0].Opportunity__c);    	
    }
}